package com.example.managesystem.web;

import com.example.managesystem.entity.backGround;
import com.example.managesystem.entity.headImages;
import com.example.managesystem.service.imageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("index")
public class imageController {
    @Autowired
    private imageService imageService;

    /**
     * @description:  在添加页面填充input内的图片路径
     * @param: [mod]
     * @return: java.lang.String
     * @author Yang
     * @date: 2022/6/22 23:28
     */
    @RequestMapping("/add-new-post")
    public String add(Model mod){
        List<backGround> list=imageService.selectBack();
        List<headImages> list1=imageService.selectImages();
        mod.addAttribute("backList",list);
        mod.addAttribute("imageList",list1);
        return "/add-new-post";
    }
}
